<!DOCTYPE html>
<html lang="zh">

	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="stylesheet" type="text/css" href="css/reset.css" />
		<link rel="stylesheet" href="css/line_item.css" />
		<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="js/template.js"></script>
		<script type="text/javascript" src="js/index.js"></script>
		<title>保单详情</title>
		<style>
			dd,
			dt,
			body,
			html,
			* {
				max-height: 9999px !important;
				max-width: 9999px !important;
				-webkit-text-size-adjust: 100% !important;
				-moz-text-size-adjust: 100% !important;
				-ms-text-size-adjust: 100% !important;
				text-size-adjust: 100% !important;
			}
			
			.uploader-img {
				width: 5.6rem;
				height: 3.6rem;
			}
		</style>

	</head>

	<body>
		<!-- header_头部  -->
		<header>
			<p>
				<a href="personal_application.html"></a>
				<i>保单详情</i>
			</p>
		</header>
		<!-- section_骨架 -->
		<section id="temp-box">
			<script id="temp" type="text/html">
				<!-- order_information_订单详细信息 -->
				<div class="order_information">
					<h3>订单详细信息</h3>
					<p><i>合同编号:</i><em>{{rs.contractNumber}}</em></p>
					<p><i>申请时间:</i><em>{{rs.addTime|getMyDate}}</em></p>
					<p><i>合同状态:</i><em>{{rs.loanStatus|formatLoanStatus}}</em></p>
				</div>
				<!-- basic_information_基本信息 -->
				<div class="basic_information">
					<h3>基本信息</h3>
					<p><i>客户名称:</i><em>{{user.username}}</em></p>
					<p><i>证件类型:</i><em>身份证</em></p>
					<p><i>身份证号:</i><em>{{user.idNumber}}</em></p>
					<p><i>手机号:</i><em>{{user.phone}}</em></p>
					<p><i>银行名:</i><em>{{user.bank}}</em></p>
					<p><i>银行卡号:</i><em>{{user.bankCardNumber}}</em></p>
				</div>
				<!-- insurance_information_保险信息 -->
				<div class="insurance_information">
					<h3>保险信息</h3>
					<p><i>门店:</i><em>{{if rs.insuranceDoor}}{{rs.insuranceDoor.name}}{{/if}}</em></p>
					<p class="f1_bod"><i>保险产品:</i>
						<em>
							{{if rs.loanType=='COMMERCIAL_CAR_STRONG_INSURANCE'}}
							{{if rs.strongInsurance=='BUY'}}交强险购买{{else if rs.strongInsurance=='NOT_BUY'}}交强险不购买{{/if}}</br>
							{{if rs.carInsurance=='BUY'}}车船险购买{{else if rs.carInsurance=='NOT_BUY'}}车船险不购买{{/if}}</br>
							{{/if}}
							第三方责任险{{rs.liabilityInsurance}}</br>
							{{if rs.vehicleLossInsurance=='BUY'}}车辆损失险购买{{else if rs.vehicleLossInsurance=='NOT_BUY'}}车辆损失险不购买{{/if}}</br>
							{{if rs.noDeductibles=='BUY'}}不计免赔购买{{else if rs.noDeductibles=='NOT_BUY'}}不计免赔不购买{{/if}}</br>
							车上人员责任险每座{{rs.personnelLiabilityInsurance}}</br>
							{{if rs.robberyAndTheftInsurance=='BUY'}}全车盗抢险购买{{else if rs.robberyAndTheftInsurance=='NOT_BUY'}}全车盗抢险不购买{{/if}}</br>
							{{if rs.riskOfGlassBreakage=='BUY'}}玻璃单独破损险购买{{else if rs.riskOfGlassBreakage=='NOT_BUY'}}玻璃单独破损险不购买{{/if}}</br>
							{{if rs.selfIgnitionLossInsurance=='BUY'}}自然损失险购买{{else if rs.selfIgnitionLossInsurance=='NOT_BUY'}}自然损失险不购买{{/if}}</br>
							{{if rs.vehicleScratchRisk=='BUY'}}车身划痕损失险购买{{else if rs.vehicleScratchRisk=='NOT_BUY'}}车身划痕损失险不购买{{/if}}</br>
						</em>
					</p>
					<p><i>分期险种:</i><em>{{if rs.loanType=='COMMERCIAL_CAR_STRONG_INSURANCE'}}商业险+交强险+车船税{{else/}}商业险{{/if}}</em></p>
					<!--<p><i>保险业务:</i><em>保险业务</em></p>-->
					<p><i>消费金抵扣:</i><em>使用了{{rs.user.userId,rs.totalMoney|getIntegral}}消费金，抵扣了{{rs.user.userId,rs.totalMoney|getDMoney}}元</em></p>
					<p><i>保险总价:</i><em>{{rs.insuranceMoney}}元</em></p>
					<p><i>贷款金额:</i><em>{{rs.user.userId,rs.totalMoney|dTotalMoney}}元</em></p>
					<p><i>分期数:</i><em>{{rs.number}}</em></p>
					<p><i>车架号:</i><em>{{if rs.policy}}{{rs.policy.frameNumber}}{{/if}}</em></p>
					<p><i>保险类型:</i><em>{{if rs.stagingType=='THE_FIRST_INSURANCE'}}首保{{else/}}续保{{/if}}</em></p>
					<p><i>保险公司:</i><em>{{if rs.insuranceCompany}}{{rs.insuranceCompany.name}}{{/if}}</em></p>
					<p><i>保单号:</i><em>{{if rs.policy}}{{rs.policy.policyNumber}}{{/if}}</em></p>
					<p><i>保单号2:</i><em>{{if rs.policy}}{{rs.policy.policyNumber2}}{{/if}}</em></p>
					{{if rs.loanType=='COMMERCIAL_CAR_STRONG_INSURANCE'}}
					<p><i>商业险金额:</i><em>{{rs.commercialInsuranceMoney}}元</em></p>
					<p><i>车船税金额:</i><em>{{rs.vehicleAndVesselTax}}元</em></p>
					{{/if}}
					<p><i>汽车品牌型号:</i><em>{{rs.carBrand}}</em></p>
					<p><i>购买渠道:</i><em>{{rs.purchaseChannel}}</em></p>
				</div>
				<!-- detail_分期明细 -->
				<div class="detail">
					<h3>分期明细</h3>
					<ul id="fenqiDetail"></ul>
				</div>
				<!-- picture_information_照片信息 -->
				<div class="picture_information">
					<h3>照片明细</h3>
					<div>
						<h3>行驶证:</h3>
						<div class="left f1_boe">
							<img src="{{rs.originalDrivingLicense}}" class="uploader-img" alt="" />
						</div>
						<div class="right f1_boe">
							<img src="{{rs.copyOfDrivingLicense}}" class="uploader-img" alt="" />
						</div>
					</div>
					<div>
						<h3>身份证:</h3>
						<div class="left f1_boe">
							<img src="{{rs.facadeOfIdCard}}" class="uploader-img" alt="" />
						</div>
						<div class="right f1_boe">
							<img src="{{rs.identityCard}}" class="uploader-img" alt="" />
						</div>
					</div>
					<div>
						<h3>银行卡:</h3>
						<div class="left f1_boe">
							<img src="{{rs.bankCardFront}}" class="uploader-img" alt="" />
						</div>
						<h3>其他照片:</h3>
						<div class="right f1_boe">
							<img src="{{rs.otherPicture}}" class="uploader-img" alt="" />
						</div>
					</div>
					{{if rs.policy}}
					<div>
						<h3>保单图1:</h3>
						<div class="left f1_boe">
							<img class="uploader-img" src="{{if rs.policy}}{{rs.policy.policyPicture}}{{/if}}" />
						</div>
						<h3>保单图2:</h3>
						<div class="right f1_boe">
							<img class="uploader-img" src="{{if rs.policy}}{{rs.policy.policyPicture2}}{{/if}}" />
						</div>
					</div>
					<div>
						<h3>保单发票:</h3>
						<div class="left f1_boe">
							<img class="uploader-img" src="{{if rs.policy}}{{rs.policy.invoice}}{{/if}}" />
						</div>
						<h3>保单发票2:</h3>
						<div class="right f1_boe">
							<img class="uploader-img" src="{{if rs.policy}}{{rs.policy.invoice2}}{{/if}}" />
						</div>
					</div>
					{{/if}}
					<div>
						<h3>其他证件:</h3>
						<div class="left f1_boe">
							<img class="uploader-img" src="{{rs.otherDocuments}}" />
						</div>
						<h3>其他照片:</h3>
						<div class="right f1_boe">
							<img class="uploader-img" src="{{rs.otherPicture}}" />
						</div>
					</div>
				</div>
				{{if rs.loanStatus!='FIRST_TRIAL_PASS'}}
				<div class="basic_information">
					<h3>收货信息</h3>
					<p><i>收货人姓名:</i><em>{{rs.consignee}}</em></p>
					<p><i>联系方式:</i><em>{{rs.consigneePhone}}</em></p>
					<!--<p><i>省:</i><em>{{rs.province}}</em></p>
					<p><i>市:</i><em>{{rs.city}}</em></p>
					<p><i>区/县:</i><em>{{rs.district}}</em></p>-->
					<p><i>送货地址:</i><em>{{rs.province}}{{rs.city}}{{rs.district}}{{rs.address}}</em></p>
				</div>
				{{/if}}
				<div class="basic_information">
					<h3>审核信息</h3>
					<p><i>审核意见:</i><em>{{rs.opinion}}</em></p>
				</div>
			</script>
		</section>
	</body>
	<script type="text/javascript">
		$(function() {
			$.get(site + "/Loan/queryLoanInfo", {
				id: GetQueryString('id')
			}, function(da) {
				var _da = da;
				$.ajaxSetup({
					async: false
				});
				if(da.data.user.identity == 1) {
					$.get(site + "/Loan/queryMyAuthentication", {
						"userId": da.data.user.userId
					}, function(da) {
						$("#temp-box").html(template('temp', {
							rs: _da.data,
							user: da.data
						}));
					})
				} else {
					$("#temp-box").html(template('temp', {
						rs: _da.data,
						user: _da.data
					}));
				}
				getDaikuanDetail(da.data.totalMoney, da.data.number);
			});
		});


		function GetQueryString(name) {
			var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
			var r = window.location.search.substr(1).match(reg);
			if(r != null) return unescape(r[2]);
			return null;
		}

		//获取贷款明细
		function getDaikuanDetail(totalMoney, number) {
			$.ajax({
				type: "get",
				url: site + "/Loan/queryStagingDetail",
				dataType: 'json',
				data: {
					"totalMoney": totalMoney,
					"number": number
				},
				success: function(da) {
					$("#fenqiDetail").html(template("fenqiDetail-temp", {
						list: da.data
					}));
				}
			});
		}
	</script>

</html>

<script id="fenqiDetail-temp" type="text/html">
	{{each list as rs i}}
	<li><i>{{i+1}}</i><em>{{rs.date}}</em><b>{{rs.money}}元</b></li>
	{{/each}}
</script>